package com.wnxy.mapper;

import com.wnxy.dto.RolePathDto;
import com.wnxy.model.Manager;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author alice
 * @since 2021-10-25
 */
public interface ManagerMapper extends BaseMapper<Manager> {
//@Select("SELECT p.path_url FROM t_path p JOIN t_role_path rp on p.path_id= rp.path_id JOIN t_manager_role mr ON mr.role_id= rp.role_id WHERE mr.manager_id=#{managerId} AND p.path_url LIKE '#{pathUrl}'")
//    String selectPath(@Param("managerId") Integer managerId,@Param("pathUrl") String pathUrl);
@Select("SELECT mr.manager_id, p.path_url,rp.role_id FROM t_path p JOIN t_role_path rp on p.path_id= rp.path_id JOIN t_manager_role mr on mr.role_id=rp.role_id WHERE mr.manager_id=#{managerId}")
List<RolePathDto> selectPath(@Param("managerId") Integer managerId);
    @Select("SELECT  p.path_url,rp.role_id FROM t_path p JOIN t_role_path rp on p.path_id= rp.path_id JOIN t_manager_role mr on mr.role_id=rp.role_id ")
    List<RolePathDto> selectAllPath();
}
